#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "Motor.h"
#include "Hall.h"
#include "UART.h"

int main(void)
{
    Motor_Init();
    Hall_Init();
    UART_Init();
    
    uint32_t left_speed, right_speed;
    uint32_t left_pulse, right_pulse;
    
    UART_Printf("System Start\r\n");
    
    Motor_SetSpeed(1500, 1500);
    
    while (1)
    {
        Delay_ms(100);
        Hall_GetSpeed(&left_speed, &right_speed);
        Hall_GetPulse(&left_pulse, &right_pulse);
        UART_Printf("Pulse: L=%d R=%d | Speed: L=%d R=%d mm/s\r\n", left_pulse, right_pulse, left_speed, right_speed);
    }
}
